﻿[cmdletbinding(SupportsShouldProcess=$true)]
Param($msg)

function Main()
{
	if ( $PSCmdlet.ShouldProcess($msg) ) { Write-Host $msg }
	@(1,2,3,"qwe",2.4)+@(Get-Process 'explorer') | Write-Object
}

function Write-Object{
[CmdletBinding(SupportsShouldProcess=$true)]
param (
	[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
	$obj
)
	process{
		if ( $PSCmdlet.ShouldProcess("$($obj.GetType().Name) $obj" )){ Write-Host $obj}
	}
}


Main